home *** CD-ROM | disk | FTP | other *** search
- /* ---------------------------------------------------------------------- */
- /* class TOptionViewer */
- /* */
- /* Palette layout */
- /* 1 = Active */
- /* 2 = Inactive */
- /* 3 = Focused */
- /* 4 = Selected */
- /* 5 = Divider */
- /* ---------------------------------------------------------------------- */
-
- #if defined( Uses_TOptionViewer ) && !defined( __TOptionViewer )
- #define __TOptionViewer
-
- class far TRect;
- class far TScrollBar;
- class far TCollection;
-
- class TOptionViewer : public TListViewer
- {
-
- public:
-
- TOptionViewer( const TRect& bounds,
- TScrollBar *aHScrollBar,
- TScrollBar *aVScrollBar,
- TCollection *aList
- );
-
- virtual TPalette& getPalette() const;
- virtual void getText( char *dest, short item, short maxLen );
- virtual void handleEvent( TEvent& event );
- int optionWidth();
-
- virtual TCollection *list();
- virtual void newList( TCollection *aList );
-
- protected:
-
- TCollection *items;
-
- };
-
- #endif // Uses_TOptionViewer
-
- #if defined( Uses_TOptionWindow ) && !defined( __TOptionWindow )
- #define __TOptionWindow
-
- class far TListViewer;
- class far TRect;
- class far TWindow;
- class far TInputLine;
- class far TCollection;
-
- class TOptionInit
- {
-
- public:
-
- TOptionInit( TListViewer *(*cListViewer)( TRect, TWindow *,
- TCollection * ) );
-
- protected:
-
- TListViewer *(*createListViewer)( TRect, TWindow *, TCollection * );
-
- };
-
- /* ---------------------------------------------------------------------- */
- /* TOptionWindow */
- /* */
- /* Palette layout */
- /* 1 = Frame passive */
- /* 2 = Frame active */
- /* 3 = Frame icon */
- /* 4 = ScrollBar page area */
- /* 5 = ScrollBar controls */
- /* 6 = HistoryViewer normal text */
- /* 7 = HistoryViewer selected text */
- /* ---------------------------------------------------------------------- */
-
- class TOptionWindow : public TWindow, public virtual TOptionInit
- {
-
- public:
-
- TOptionWindow( const TRect& bounds, TCollection *aList );
-
- virtual TPalette& getPalette() const;
- virtual void getSelection( char *dest );
- static TListViewer *initViewer( TRect, TWindow *, TCollection * );
-
- virtual TCollection *list();
- virtual void newList( TCollection *aList );
-
- protected:
-
- TListViewer *viewer;
- };
-
- #endif // Uses_TOptionWindow
-
- #if defined( Uses_TOption ) && !defined( __TOption )
- #define __TOption
-
- class far TRect;
- class far TInputLine;
- class far TEvent;
- class far TOptionWindow;
- class far TCollection;
-
- class TOption : public TView
- {
-
- public:
-
- TOption( const TRect& bounds, TInputLine *aLink, TCollection *aList );
-
- virtual void draw();
- virtual TPalette& getPalette() const;
- virtual void handleEvent( TEvent& event );
- virtual TOptionWindow *initOptionWindow( const TRect& bounds );
- virtual void shutDown();
-
- virtual TCollection *list();
- virtual void newList( TCollection *aList );
- protected:
-
- TInputLine *link;
- TCollection *items;
-
- private:
-
- static const char * near icon;
-
- virtual const char *streamableName() const
- { return name; }
-
- protected:
-
- TOption( StreamableInit );
- virtual void write( opstream& );
- virtual void *read( ipstream& );
-
- public:
-
- static const char * const near name;
- static TStreamable *build();
-
- };
-
- inline ipstream& operator >> ( ipstream& is, TOption& cl )
- { return is >> (TStreamable&)cl; }
- inline ipstream& operator >> ( ipstream& is, TOption*& cl )
- { return is >> (void *&)cl; }
-
- inline opstream& operator << ( opstream& os, TOption& cl )
- { return os << (TStreamable&)cl; }
- inline opstream& operator << ( opstream& os, TOption* cl )
- { return os << (TStreamable *)cl; }
-
- #endif // Uses_TOption
-
-